﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

using XueMeng.BLL;
using XueMeng.Model;

namespace UI
{
    public partial class TaskMain : Form
    {

        /**
         * 
         * 
         * **/
        private readonly TaskManager tm = new TaskManager();


        public TaskMain()
        {
            InitializeComponent();
        }

        private void TaskMain_Load(object sender, EventArgs e)
        {
            this.dataGridView1.AutoGenerateColumns = false;
            this.dataGridView2.AutoGenerateColumns = false;
            this.dataGridView3.AutoGenerateColumns = false;
            this.dataGridView4.AutoGenerateColumns = false;
            this.dataGridView5.AutoGenerateColumns = false;
            LoadData();
            LoadEvent();
        }

        private void LoadEvent()
        {

        }

        private void LoadData()
        {
            this.dataGridView1.DataSource = tm.GetList("T_Id in (SELECT T_Id FROM dbo.Auction Where Enable = 0) And Enable = 0").Tables[0];
            this.dataGridView2.DataSource = tm.GetList("T_Id not in (SELECT T_Id FROM dbo.Auction Where Enable = 0) And Enable = 0").Tables[0];
            this.dataGridView3.DataSource = tm.GetList("T_Id in (SELECT T_Id FROM dbo.Auction Where Enable = 1) AND T_Id IN (SELECT T_Id FROM dbo.EmpTask WHERE Enable = 0) And Enable = 1").Tables[0];
            this.dataGridView4.DataSource = tm.GetList("T_Id in (SELECT T_Id FROM dbo.EmpTask Where Enable = 1) And Enable = 1").Tables[0];

        }
    }
}
